home *** CD-ROM | disk | FTP | other *** search
- Path: metroux.metrobbs.com!news
- From: cakirke@metroux.metrobbs.com (Chris Kirke)
- Newsgroups: comp.lang.c
- Subject: Re: Zombies & Daemons
- Date: 5 Mar 1996 03:30:56 GMT
- Organization: Metropolis BBS
- Message-ID: <4hgchg$t34@metroux.metrobbs.com>
- References: <3134348F.7526@citenet.net>
- NNTP-Posting-Host: metrix.metrobbs.com
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.11
-
- In article <3134348F.7526@citenet.net>, oliver@citenet.net says...
- >
- >I've just finished writting a daemon to handle generating web
- >pages from an Oracle database. When it executes, the parent forks a
- >number of children, all of which are bound to a network port. Each child
- >services requests in order etc. etc. works more or less like an apache
- >httpd...
- >
- > The problem is this: when one of the children dies for whatever
- >reason (usually a f*cked OCI call which makes the daemons session
- >unstable), the parent's sigcld handler forks a new child to keep a
- >consistent number of processes running. For some reason, however, the
- >dead child process lingers around as a zombie process ... how do I avoid
- >this?
- >
- > Also, does SunOS support copy on write memory pages? And do
- >zombie processes still use system resources?
- >
- >Later,
- >Oliver Lavery
-
- I believe the only resource a zombie process uses is a process table
- entry (which is overlaid with some info for a process that waits on it).
- Depending on your implementation, you may have to "wait" on the dead
- child process after trapping this sigcld in order for the system to
- discard the zombie. (You can disable zombie creation by ignoring sigcld
- in the parent process but then you wouldn't be able to sense the child's
- death and create another child)
-
- --
- >-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->
- | |
- | Chris Kirke - cakirke@metroux.metrobbs.com |
- | |
- | the opinions expressed here ..... whatever |
- | |
- <--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<
-
-